package com.qing.apple.filter.demo01;

import com.qing.apple.filter.bean.Apple;
import com.qing.apple.filter.bean.InitApple;

import java.util.ArrayList;
import java.util.List;

/**
 * Java8 之前的筛选苹果方法，没增加一项筛选就新增，相似的筛选代码
 */
public class Demo {

	public static void main(String[] args) {
		List<Apple> appleList= InitApple.getApples();
		//获取所有绿色的苹果
		AppleService.filterGreenColor(appleList).forEach(item->{
			System.out.println(item.toString());
		});
		//获取所有重量>150的苹果
		AppleService.filtersHeavyApple(appleList).forEach(item->{
			System.out.println(item.toString());
		});
	}
}
